@extends('common.layouts')
@section('content')
<div class="content-wrap">
  <div class="main">
      <div class="container-fluid">
          <div class="main-content"> 
              @include('common.message')
              @include('common.validator')
              <div class="row">
                  <div class="col-lg">
                      <div class="card alert">
                          <div class="card-header">
                              <h4>@yield('headerTitle',"用户新增")</h4>
                          </div>
                          <form action="{{ url("usercreate") }}" method="POST">
                          {{-- post请求加上安全验证 --}}
                            @csrf
                            <div class="form-group">
                              <label for="exampleInputEmail1">账户名</label>
                              {{-- 使用old函数可以将用户填的错误信息，再通过控制器传回来显示在value属性中
                                因为是通过数组属性传上去保存的，所以要传入数组名取出数据，并通过数组下标取出值显示
                                --}}
                              <input type="text"name="UserSmbms[userName]" value="{{ old("UserSmbms")["userName"] }}" class="form-control" id="exampleInputEmail1" placeholder="账户名">
                            </div>
                            <div class="form-group">
                              <label for="exampleInputPassword1">密码</label>
                              <input type="password" value="{{ old("UserSmbms")["password"] }}" name="UserSmbms[password]" class="form-control" id="exampleInputPassword1" placeholder="密码">
                            </div>
                            <div class="form-group">
                              <label for="exampleInputPassword1">确认密码</label>
                              <input type="password"  name="UserSmbms[password_confirmation]" class="form-control" id="exampleInputPassword1" placeholder="确认密码">
                            </div>
                            <div class="form-group">
                              <label for="exampleInputPassword1">性别</label>
                              <input type="radio" name="UserSmbms[gender]" style="margin-left:10px;width:20px;height:20px" value="1">男
                              <input type="radio" name="UserSmbms[gender]"style="margin-left:10px;width:20px;height:20px" value="2">女
                            </div>
                            <div class="form-group">
                              <label for="exampleInputPassword1">手机号码</label>
                              <input type="number" value="{{ old("UserSmbms")["phone"] }}" name="UserSmbms[phone]"class="form-control" id="exampleInputPassword1"placeholder="手机号码" >
                            </div>
                            <div class="form-group">
                              <label for="exampleInputPassword1">用户地址</label>
                              <input type="text" value="{{ old("UserSmbms")["address"] }}" name="UserSmbms[address]"class="form-control" id="exampleInputPassword1"placeholder="用户地址" >
                            </div>
                            <button type="submit" class="btn btn-info btn-lg" style="margin-left:45%;">新增</button>
                          </form>
                      </div>
                  </div>
              </div>

@endsection
